//2009/08/28 00:11:27
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class CircularLine
{
public:
    int longestTravel(vector <int> t)
    {
        int ret = 0;
        for (int i = 0; i < t.size(); i++) // Start;
            for (int j = i + 1; j < t.size(); j++) // End;
            {
                int a = 0, b = 0;
                for (int k = i; k < j; k++) a += t[k];
                for (int k = j; k < t.size(); k++) b += t[k];
                for (int k = 0; k < i; k++) b += t[k];
                ret = max(ret, min(a,b));
            }
        return ret;

    }
};
